package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.HlsCashflowTypeMapper;
import com.bestow.basic.domain.HlsCashflowType;
import com.bestow.basic.service.IHlsCashflowTypeService;

/**
 * 现金流类型Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-07
 */
@Service
public class HlsCashflowTypeServiceImpl implements IHlsCashflowTypeService 
{
    @Autowired
    private HlsCashflowTypeMapper hlsCashflowTypeMapper;

    /**
     * 查询现金流类型
     * 
     * @param cfType 现金流类型主键
     * @return 现金流类型
     */
    @Override
    public HlsCashflowType selectHlsCashflowTypeByCfType(String cfType)
    {
        return hlsCashflowTypeMapper.selectHlsCashflowTypeByCfType(cfType);
    }

    /**
     * 查询现金流类型列表
     * 
     * @param hlsCashflowType 现金流类型
     * @return 现金流类型
     */
    @Override
    public List<HlsCashflowType> selectHlsCashflowTypeList(HlsCashflowType hlsCashflowType)
    {
        return hlsCashflowTypeMapper.selectHlsCashflowTypeList(hlsCashflowType);
    }

    /**
     * 新增现金流类型
     * 
     * @param hlsCashflowType 现金流类型
     * @return 结果
     */
    @Override
    public int insertHlsCashflowType(HlsCashflowType hlsCashflowType)
    {
        hlsCashflowType.setCreateTime(DateUtils.getNowDate());
        return hlsCashflowTypeMapper.insertHlsCashflowType(hlsCashflowType);
    }

    /**
     * 修改现金流类型
     * 
     * @param hlsCashflowType 现金流类型
     * @return 结果
     */
    @Override
    public int updateHlsCashflowType(HlsCashflowType hlsCashflowType)
    {
        hlsCashflowType.setUpdateTime(DateUtils.getNowDate());
        return hlsCashflowTypeMapper.updateHlsCashflowType(hlsCashflowType);
    }

    /**
     * 批量删除现金流类型
     * 
     * @param cfTypes 需要删除的现金流类型主键
     * @return 结果
     */
    @Override
    public int deleteHlsCashflowTypeByCfTypes(String[] cfTypes)
    {
        return hlsCashflowTypeMapper.deleteHlsCashflowTypeByCfTypes(cfTypes);
    }

    /**
     * 删除现金流类型信息
     * 
     * @param cfType 现金流类型主键
     * @return 结果
     */
    @Override
    public int deleteHlsCashflowTypeByCfType(String cfType)
    {
        return hlsCashflowTypeMapper.deleteHlsCashflowTypeByCfType(cfType);
    }
}
